<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<logic:notPresent name="user" scope="session">
	<logic:redirect href="createUser.do"></logic:redirect>
</logic:notPresent>

<logic:present name="user" scope="session">
	<c:choose>
		<c:when test="${sessionScope.user.isBlocked == false}">
			<c:choose>
				<c:when test="${sessionScope.user.role == 1}">
					<tiles:insert definition="main-template-admin">
						<tiles:put name="content" value="/pages/tiles/main/template-admin/content.jsp" />
					</tiles:insert>
				</c:when>
				<c:when test="${sessionScope.user.role == 2}">
					<tiles:insert definition="main-template-customer">
						<tiles:put name="content" value="/pages/tiles/main/content.jsp" />
					</tiles:insert>
				</c:when>
				<c:when test="${sessionScope.user.role == 3}">
					<tiles:insert definition="main-template-user">
						<tiles:put name="content" value="/pages/tiles/main/content.jsp" />
					</tiles:insert>
				</c:when>
				<c:otherwise>
					<c:out value="Please reenter"></c:out>
				</c:otherwise>
			</c:choose>
		</c:when>
		
		<c:otherwise>
			<tiles:insert definition="main-template-user">
				<tiles:put name="content" value="/pages/tiles/main/content.jsp" />
			</tiles:insert>
		</c:otherwise>

	</c:choose>

</logic:present>



